<?php

/**
 * Course form.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class CourseForm extends BaseCourseForm
{
  public function configure()
  {
	unset($this['created_at'], $this['updated_at']); 
	$this->setDefaults( array('create_at' => time(), 'update_at' => time() ) );
	$course = $this->getObject();
	if( $course->getStatus() == 0 )
	$course->setStatus(NULL);   
	// check box : cls_status
	$this->widgetSchema['status'] = new sfWidgetFormInputCheckbox(array("value_attribute_value" => 1),array('value' => 1));	
	// get culture
	$lang_current = sfContext::getInstance()->getUser()->getCulture();
	$this->languages = array($lang_current => $lang_current);
	$langs = array_keys($this->languages);
	$this->embedI18n($langs);
	foreach($this->languages as $lang => $label)
	{
		$this->widgetSchema[$lang]->setLabel($label);
	}
  }
}
